{% for table_setting in [
    'monitor_batch_inserts',
    'monitor_split_batch_on_failure',
    'monitor_sleep_time_ms',
    'monitor_max_sleep_time_ms',

    'background_insert_batch',
    'background_insert_split_batch_on_failure',
    'background_insert_sleep_time_ms',
    'background_insert_max_sleep_time_ms',
] %}
drop table if exists dist_{{ table_setting }};
create table dist_{{ table_setting }} as system.one engine=Distributed(test_shard_localhost, system, one) settings {{ table_setting }}=1;
show create dist_{{ table_setting }};
drop table dist_{{ table_setting }};
{% endfor %}

create table data (key Int) engine=Null();
create table dist (key Int) engine=Distributed(test_shard_localhost, currentDatabase(), data, key);
{% for query_setting in [
    'distributed_directory_monitor_sleep_time_ms',
    'distributed_directory_monitor_max_sleep_time_ms',
    'distributed_directory_monitor_batch_inserts',
    'distributed_directory_monitor_split_batch_on_failure',

    'insert_distributed_sync',
    'insert_distributed_timeout',
] %}
insert into dist settings {{query_setting}}=1 values (1);
system flush distributed dist;
{% endfor %}
